package com.bynk.bynk_demo.controller;

import com.bynk.bynk_demo.common.result.Result;
import com.bynk.bynk_demo.model.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

@RestController
public class LoginController {


    @PostMapping("/login")
    public Result login(User user, HttpServletRequest request, HttpServletResponse response){

        HttpSession session = request.getSession();

        session.setAttribute("user",user);


        return Result.success("askdjsd");

    }
}
